package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.dto.ConfigDTO;
import com.ydd.entity.SysConfig;
import com.ydd.vo.ConfigGroupVO;
import com.ydd.vo.GroupValueVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface SysConfigMapperMB {
//    @Select("select * from sys_config")
    List<SysConfig> getConfig(SysConfig Config);

    @Select("SELECT tab_value  FROM sys_config GROUP BY tab_value ")
    List<String> getTabvalue();

    @Select("SELECT group_value as name  FROM sys_config WHERE tab_value=#{s} GROUP BY group_value ")
    List<ConfigGroupVO> getConfigValue(String s);

    @Select("SELECT * FROM sys_config WHERE group_value=#{name}")
    List<GroupValueVO> getData(String name);

    @Update("update sys_config set attr_value=#{attrValue} where id =#{id} and attr_key=#{attrKey}")
    void update(ConfigDTO dtos);
}
